import request from '@/utils/request'

// 查询员工列表
export function selectAllStaff(params) {
  return request({
    url: '/staff/list',
    method: 'get',
    params
  })
}

// 查询部门列表
export function selectAllDepartments() {
  return request({
    url: '/department/list',
    method: 'get'
  })
}

// 新增员工
export function addStaff(data) {
  return request({
    url: '/staff/add',
    method: 'post',
    data: data
  })
}

// 获取员工详情
export function getStaff(params) {
  return request({
    url: '/staff/detail',
    method: 'get',
    params
  })
}

// 修改员工信息
export function updateStaff(data) {
  return request({
    url: '/staff/update',
    method: 'put',
    data: data
  })
}

// 删除员工
export function deleteStaff(ids) {
  return request({
    url: '/staff/delete',
    method: 'delete',
    data: ids
  })
}